<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');


class Index extends CI_Controller {

	function __construct()
	{
		parent::__construct();
	}

	public function index()
	{
		$this->load->helper('captcha');
		
		$vals = array(
			
    		'img_path' => './statics/captcha/',
			'img_url' => 'http://cireg.com/statics/captcha/',
		 	'font_path' => './system/fonts/CONSOLAI.TTF',	
			'img_width' => '200',
    		'img_height' => '35',

		);

		$cap = create_captcha($vals);
		$captchadata = array(
   		'captcha_time' => $cap['time'],
    	'ip_address' => $this->input->ip_address(),
   		 'word' => $cap['word']
		);
		$query = $this->db->insert_string('captcha', $captchadata);
		$this->db->query($query);
		//var_dump($cap);
		$data['captcha']=$cap['image'];
		$this->load->view('login',$data);

	}

}
?>